
$(function() {
	//init menu text
	$('.header li:not(.logo, .current)').find('.icon').next().css('top', '-30px').fadeOut(0);

	//menu slide-up
	function slideUp(el) {
		var text = el.parent().next();
		el.animate({
			top: '-34'
		}, 150);
		//text.fadeIn(150);
		text.animate({
			top: '-22',
			'opacity': 'toggle'
		}, 150);

		//text.attr('style', 'top:-22px;');
	}

	//menu slide-down
	function slideDown(el) {
		var text = el.parent().next();
		el.animate({
			top: '0'
		}, 150);
		text.animate({
			top: '-30',
			'opacity': 'toggle'
		}, 150);
	}

	$('.header ul li a:not(.logo)').hover(
			function() {
				slideUp($(this).find('.icon span'));
			},
			function() {
				slideDown($(this).find('.icon span'));
			});

	//slideUp button
	function slideUpBtn(el) {
		el.find('em').animate({
			top: '-16'
		}, 150);
	}

	//slideDown button
	function slideDownBtn(el) {
		el.find('em').animate({
			top: '0'
		}, 150);
	}

	$('.portfolio_btn, .about_btn, .blog_btn, .closer_btn ').hover(
			function() {
		slideUpBtn($(this));
	},
			function() {
		slideDownBtn($(this));		
			});
});


$(window).load(function() {
	$('#slider').nivoSlider({
			effect:'fold', //Specify sets like: 'fold,fade,sliceDown'
			slices:30,
			animSpeed:500,
			pauseTime:4000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:false, //Only show on hover
			controlNav:false, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
		  controlNavThumbsFromRel:false, //Use image rel for thumbs
			keyboardNav:false, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:0.8 //Universal caption opacity
		});
});